﻿Public Class Recetas

    Private Sub RecetaBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RecetaBindingNavigatorSaveItem.Click
        Me.Validate()
        Me.RecetaBindingSource.EndEdit()
        Me.TableAdapterManager.UpdateAll(Me.DsRecetas)

    End Sub

    Private Sub Recetas_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: esta línea de código carga datos en la tabla 'DsRecetas.Receta' Puede moverla o quitarla según sea necesario.
        Me.RecetaTableAdapter.Fill(Me.DsRecetas.Receta)

    End Sub

    Private Sub NombreTextBox_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles NombreTextBox.KeyPress
        'ACEPTA SOLO NUMEROS Y ENTER PASA AL SGTE. FOCO
        If e.KeyChar >= Chr(48) And e.KeyChar <= Chr(57) Or e.KeyChar = Chr(8) Then
            e.Handled = False
        Else
            If e.KeyChar = ChrW(Keys.Enter) Then
                e.Handled = True
                SendKeys.Send("{TAB}")
            Else
                If e.KeyChar < Chr(48) Or e.KeyChar > Chr(57) Then
                    e.Handled = True
                End If
            End If
        End If
    End Sub

    Private Sub NombreTextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NombreTextBox.TextChanged

    End Sub

    Private Sub ObservacionTextBox_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles ObservacionTextBox.KeyPress
        If e.KeyChar = ChrW(Keys.Enter) Then
            e.Handled = True
            SendKeys.Send("{TAB}")
        End If
    End Sub

    Private Sub ObservacionTextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ObservacionTextBox.TextChanged

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles VerIngredientesButton.Click
        idReceta_global = ""
        idReceta_global = IdRecetaTextBox.Text.Trim
        My.Forms.Recetas_Ingredientes.NombreTextBox.Text = Me.NombreTextBox.Text.Trim
        My.Forms.Recetas_Ingredientes.ShowDialog()
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CerrarButton.Click
        Me.Close()
    End Sub

    Private Sub ListadoRecetasButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListadoRecetasButton.Click

    End Sub
End Class